// 定义路由表:
// 路由表就是就是一个数组,记录了前端路由规则的一些信息
import { Navigate } from 'react-router-dom'
import Home from '../pages/Home'
import About from '../pages/About'
import A from '../pages/A'
import B from '../pages/B'
import Unknow from '../pages/404'
export default [
  {
    path: '/',
    element: <Home></Home>,
  },
  {
    path: 'home',
    element: <Home></Home>,
    children: [
      {
        path: 'a',
        element: <A></A>,
      },
      {
        path: 'b',
        element: <B></B>,
      },
    ],
  },
  {
    path: 'about',
    children: [
      {
        path: ':xxx',
        element: <About></About>,
      },
      {
        path: '',
        element: <About></About>,
      },
    ],
  },
  {
    path: '404',
    element: <Unknow></Unknow>,
  },
  {
    // * 表示所有
    path: '*',
    element: <Navigate to="/404"></Navigate>,
  },
]
